﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using BusinessObjects.BO_GetObjects;

public partial class Controls_ucBid : System.Web.UI.UserControl
{
    string module_id;

    public string Module_id
    {
        get { return module_id; }
        set { module_id = value; }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            loadProduct();
        }
    }

    protected void loadProduct()
    {
        DataTable objDT = BO_Products.SelectByModule(1, 1, 1, Convert.ToInt32(module_id));
        if (objDT.Rows.Count > 0)
        {
            objDT = BO_Autions.SearchByProduct(Convert.ToInt32(objDT.Rows[0]["PRODUCT_ID"]));
            if (objDT.Rows.Count > 0)
            {
                product_name.InnerText = LibraryO2S.O2S_StringUtil.Substring(objDT.Rows[0]["PRODUCT_NAME"].ToString(), 0, 31); ;
                current_price.InnerHtml = current_price.InnerHtml.Replace("90", objDT.Rows[0]["CURRENT_PRICE"].ToString());
                unit_price.InnerHtml = unit_price.InnerHtml.Replace("22.900.000", objDT.Rows[0]["UNIT_PRICE"].ToString());
                Time.InnerText = Convert.ToDateTime(objDT.Rows[0]["END_DATE"]).ToString("yyyy/MM/dd hh:mm:ss");
            }
        }
    }
}